function init() {
	_initHeader();
	
	$("#saveButton").unbind("click");
	$("#saveButton").click(clickedSaveButton);
}

function clickedSaveButton() {
	if($("#firstName").val() == "" || $("#firstName").val() == undefined || $("#firstName").val() == null) {
		alert("First name is required.");
		return false;
	}
	
	if($("#lastName").val() == "" || $("#lastName").val() == undefined || $("#lastName").val() == null) {
		alert("Last name is required.");
		return false;
	}
	
	var contactInfo = {
		"firstName" : $("#firstName").val(),
		"lastName" : $("#lastName").val(),
		"mobilePhone" : $("#mobilePhone").val(),
		"workPhone" : $("#workPhone").val(),
		"email" : $("#email").val(),
		"organization" : $("#organization").val(),
		"department" : $("#department").val(),
		"jobTitle" : $("#jobTitle").val()
	};
	
	
	contact.add(contactInfo, addContactSuccessCallback, addContactErrorCallback);
}

function addContactSuccessCallback() {
	notifySuccess("add");
	
	var navigationRule = {
		"pageId" : "contact"
	};
	
	navigation.backToOrNavigate(navigationRule);
}

function addContactErrorCallback(errorMessage) {
	notifyError("contact.add", errorMessage);
}

function onScreenBack() {
	log.log("onScreenBack on conatct_add page is called.");
}
